package com.open.capacity.point.service;

import com.open.capacity.point.dto.PointsRuleDto;
import com.baomidou.mybatisplus.extension.service.IService;
import com.open.capacity.common.exception.service.ServiceException;
import com.open.capacity.common.model.PointsRule;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;

import java.util.Map;

public interface PointsRuleService extends IService<PointsRule> {

    /**
     * 根据条件查询积分规则
     *
     * @param condition 条件参数
     * @return 积分规则集合
     */
    PageResult<PointsRuleDto> findRulesByCondition(Map<String, Object> condition) throws ServiceException;

    /**
     * 根据积分规则编号查询
     *
     * @param pointsRuleCode 积分规则编号
     * @return 积分规则
     */
    PointsRule findRuleByCode(String pointsRuleCode);

    Result saveOrUpdated(PointsRule pointsRule) throws ServiceException;

    Result delete(String id) throws ServiceException;

}
